home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1996 May / cd joy 71No13.iso / pc / demos / eurosoc / source / euro_spt.cpp < prev    next >
Text File  |  1996-03-17  |  21KB  |  818 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. #include "eurodefs.h"
  6. #include "euro_fxd.h"
  7. #include "mallocx.h"
  8. #include "euro_sym.h"
  9. #include "euro_def.h"
  10. #include "euro_var.h"
  11. #include "euro_dsk.h"
  12.  
  13. char    *script_buffer;
  14. FILE     *script_in;
  15. char    line[512];
  16. char    variable;
  17. int    variable_value;
  18.  
  19. void        Getvariable( char *buf );
  20. int         GetVariableValue( char *buf );
  21. void        ConvertLine(char *buf);
  22. void         GetTextString( char *buf);
  23. short         GetClubString( char *buf );
  24. char         GetFormationType( char *buf );
  25. char         GetTeamsCodeNumber( char *buf );
  26. char         GetPositionType( char *buf );
  27. void         GetAscCharacter( char *buf );
  28. char         GetCharacter( char *buf );
  29. short        GetDefine( char *buf );
  30. short        GetSwitch( char *buf );
  31.  
  32. short    ImageXcount    =    0;
  33. short    ImageYcount    =    0;
  34. short    ImageWcount    =    0;
  35. short    ImageHcount    =    0;
  36. short    Pagecount    =    0;
  37. short    Stringcount    =    0;
  38. short    Clubcount    =    0;
  39. short    Speechcount    =    0;
  40. short    Posncount    =    0;
  41. short    Capscount    =    0;
  42. short    Goalscount    =    0;
  43. short    Datecount    =    0;
  44. short    Starcount    =    0;
  45. char    Starplyr    =    0;
  46. short    Pacecount    =    0;
  47. short    Powercount    =    0;
  48. short    Controlcount    =    0;
  49. short    Flaircount    =    0;
  50. short    Visioncount    =    0;
  51. short    Accuracycount    =    0;
  52. short    Staminacount    =    0;
  53. short    Disciplinecount    =    0;
  54. short    Fitnesscount    =    0;
  55. short    LowerCasecount    =    32;
  56. short    Dialcount    =    32;
  57. short    Modemcount    =    0;
  58. short    ModemInitcount    =    0;
  59. short    ModemStrcount    =    0;
  60. short    Value;    
  61.  
  62. int    StringOffset    =    0;
  63. int    TempOffset    =    0;
  64. short    Formationcount    =    0;
  65. char    GroupDrawcount    =    0;
  66.  
  67. short    inst, tmpinst;
  68.     
  69. #define    ImgSym    0
  70. #define    TxtSym    1
  71.  
  72. char    Switch[128];
  73. char    Definition[16];
  74. char    DefType    = ImgSym;
  75.  
  76. #define NO_INSTRUCTION         0
  77. #define IMAGE_xCOORD         1
  78. #define IMAGE_yCOORD         2
  79. #define IMAGE_WIDTH         3
  80. #define IMAGE_HEIGHT         4
  81. #define IMAGE_PAGE         5
  82. #define    TEXT_STRING         10
  83. #define    SPEECH_ID_STRING    11
  84. //#define    STAR_MAN        12
  85. #define    LOWER_CASE        13
  86. #define    DIAL_TYPE        14
  87.  
  88. #define    FORMATION_TYPE         100
  89. #define    GROUP_DRAW_TYPE         101
  90. #define    PLAYERS_CLUB_NAME    102
  91. #define    PLAYERS_POSITION    103
  92. #define    CAPS_TYPE         104
  93. #define    GOALS_TYPE         105
  94.  
  95. #define    PACE_TYPE        106
  96. #define    POWER_TYPE        107
  97. #define    CONTROL_TYPE        108
  98. #define    FLAIR_TYPE        109
  99. #define    VISION_TYPE        110
  100. #define    ACCURACY_TYPE        111
  101. #define    STAMINA_TYPE        112
  102. #define    DISCIPLINE_TYPE        113
  103. #define    FITNESS_TYPE        114
  104. #define    DOB_TYPE        115
  105. #define    MODEM_INIT_TYPE        116
  106. #define    MODEM_STR_TYPE        117
  107. #define    MODEM_TYPE        118
  108.  
  109. #define    DEFINITION_ID        127
  110.  
  111. #define    NULL_INSTRUCTION     255
  112.  
  113.  
  114. //********************************************************************************************************************************
  115.  
  116. char    process_script_file( char *file)
  117.     {
  118.  
  119.  
  120.     script_buffer = (char *) mallocx(32768);
  121.  
  122.     if( script_buffer==NULL )
  123.         { 
  124.             printf    ("˛ ERROR.. Unable to allocate memory for script file.\n");
  125.              fflush(stdout);
  126.             return(1);
  127.         }
  128.  
  129.  
  130.     else
  131.  
  132.         {
  133.             if( script_in = fopen ( file, "rt" ), script_in != NULL )
  134.             {
  135.                 while( ReadLine ( script_in, &line[0] ) >= 0 )
  136.                 {
  137.                     inst    =    0;
  138.                     ConvertLine(&line[0]);
  139.                     memset( line, 0, 256 );
  140.  
  141.                 }
  142.                 fclose(script_in);
  143.                 printf    ("˛ %d Bytes used for script file text.\n", StringOffset);
  144.                  fflush(stdout);
  145.             }
  146.  
  147.             else
  148.             
  149.             {
  150.                 printf    ("˛ ERROR.. Trying to read script file.\n");
  151.                  fflush(stdout);
  152.             }
  153.  
  154.             freex(script_buffer);
  155.         }
  156.  
  157. //    printf("ImageXcount  =  %d\n",ImageXcount);
  158. //    printf("ImageYcount  =  %d\n",ImageYcount);
  159. //    printf("ImageWcount  =  %d\n",ImageWcount);
  160. //    printf("ImageHcount  =  %d\n",ImageHcount);
  161. //    printf("Pagecount  =  %d\n",Pagecount);
  162. //    printf("Stringcount  =  %d\n",Stringcount);
  163. //    printf("Clubcount  =  %d\n",Clubcount);
  164. //    printf("Speechcount  =  %d\n",Speechcount);
  165. //    printf("Posncount  =  %d\n",Posncount);
  166. //    printf("Capscount  =  %d\n",Capscount);
  167. //    printf("Goalscount  =  %d\n",Goalscount);
  168. //    printf("Datecount  =  %d\n",Datecount);
  169. //    printf("Starcount  =  %d\n",Starcount);
  170. //    printf("Starplyr  =  %d\n",Starplyr);
  171. //    printf("Pacecount  =  %d\n",Pacecount);
  172. //    printf("Powercount  =  %d\n",Powercount);
  173. //    printf("Controlcount  =  %d\n",Controlcount);
  174. //    printf("Flaircount  =  %d\n",Flaircount);
  175. //    printf("Visioncount  =  %d\n",Visioncount);
  176. //    printf("Accuracycount  =  %d\n",Accuracycount);
  177. //    printf("Staminacount  =  %d\n",Staminacount);
  178. //    printf("Disciplinecount  =  %d\n",Disciplinecount);
  179. //    printf("Fitnesscount  =  %d\n",Fitnesscount);
  180. //    printf("LowerCasecount  =  %d\n",LowerCasecount);
  181. //
  182.     return(0);
  183.     }
  184.  
  185. //********************************************************************************************************************************
  186.  
  187. void    ConvertLine(char *buf)
  188. {
  189.     Getvariable(buf);
  190.  
  191.     while( variable != NO_INSTRUCTION )
  192.     {
  193.  
  194.         if ( variable == IMAGE_xCOORD )
  195.             { Image_Xcoords[ImageXcount] = GetVariableValue(buf); ImageXcount++;  }
  196.  
  197.         if ( variable == IMAGE_yCOORD )
  198.             { Image_Ycoords[ImageYcount] = GetVariableValue(buf); ImageYcount++; }
  199.  
  200.         if ( variable == IMAGE_WIDTH )
  201.             { Image_Widths[ImageWcount] = GetVariableValue(buf); ImageWcount++; }
  202.  
  203.         if ( variable == IMAGE_HEIGHT )
  204.             { Image_Heights[ImageHcount] = GetVariableValue(buf); ImageHcount++; }
  205.  
  206.         if ( variable == IMAGE_PAGE )
  207.             { Image_Pages[Pagecount] = GetVariableValue(buf); Pagecount++; }
  208.  
  209.         if ( variable == TEXT_STRING )
  210.             { 
  211.               Text[Stringcount] = TextStrings+StringOffset; 
  212.               GetTextString(buf); 
  213.               if ( Stringcount < 320 )
  214.                 NamePREFIXtbl[Stringcount] = 0;
  215.               Stringcount++; 
  216.             }
  217.  
  218. //        if ( variable == LOWER_CASE )
  219. //            { GetAscCharacter(buf); LowerCasecount++;}
  220.                  
  221.         if ( variable == DIAL_TYPE )
  222.             { LegalDial[Dialcount] = GetCharacter(buf); Dialcount++;}
  223.                  
  224.         if ( variable == FORMATION_TYPE )
  225.             { FormationInfo[Formationcount] = GetFormationType(buf); Formationcount++; }
  226.  
  227.         if ( variable == GROUP_DRAW_TYPE )
  228.             { GroupDrawInfo[GroupDrawcount] = GetTeamsCodeNumber(buf); 
  229.               GroupDrawDefaultInfo[GroupDrawcount] = GroupDrawInfo[GroupDrawcount];
  230.                 GroupDrawcount++; }
  231.  
  232.         if ( variable == PLAYERS_CLUB_NAME )
  233.             { 
  234.                 TempOffset         = StringOffset;
  235.                 Clubnames[Clubcount] = TextStrings+StringOffset; 
  236.  
  237.                 short    Clubnum      = GetClubString(buf);
  238.                 
  239.                 if ( Clubnum != NOT_FOUND )
  240.                     StringOffset         = TempOffset;
  241.                 Clubcount++; 
  242.             }
  243.  
  244.         if ( variable == PLAYERS_POSITION )
  245.             { PlayerPosns[Posncount] = GetPositionType(buf); Posncount++; }
  246.  
  247.         if ( variable == CAPS_TYPE )
  248.             { PlayersCaps[Capscount] = GetFormationType(buf); Capscount++; }
  249.  
  250.         if ( variable == GOALS_TYPE )
  251.             { PlayersGoals[Goalscount] = GetFormationType(buf); Goalscount++; }
  252.  
  253.         if ( variable == DOB_TYPE )
  254.             { 
  255.                 DOBday[Datecount] = GetFormationType(buf); 
  256.                 inst++;
  257.                 DOBmonth[Datecount] = GetFormationType(buf); 
  258.                 inst++;
  259.                 DOByear[Datecount] = GetFormationType(buf); 
  260.                 Datecount++; 
  261.             }
  262.  
  263.         if ( variable == PACE_TYPE )
  264.             { Pace[Pacecount] = GetVariableValue(buf); Pacecount++; }
  265.         if ( variable == POWER_TYPE )
  266.             { Power[Powercount] = GetVariableValue(buf); Powercount++; }
  267.         if ( variable == CONTROL_TYPE )
  268.             { Control[Controlcount] = GetVariableValue(buf); Controlcount++; }
  269.         if ( variable == FLAIR_TYPE )
  270.             { Flair[Flaircount] = GetVariableValue(buf); Flaircount++; }
  271.         if ( variable == VISION_TYPE )
  272.             { Vision[Visioncount] = GetVariableValue(buf); Visioncount++; }
  273.         if ( variable == ACCURACY_TYPE )
  274.             { Accuracy[Accuracycount] = GetVariableValue(buf); Accuracycount++; }
  275.         if ( variable == STAMINA_TYPE )
  276.             { Stamina[Staminacount] = GetVariableValue(buf); Staminacount++; }
  277.         if ( variable == DISCIPLINE_TYPE )
  278.             { Discipline[Disciplinecount] = GetVariableValue(buf); Disciplinecount++; }
  279.         if ( variable == FITNESS_TYPE )
  280.             { Fitness[Fitnesscount] = GetVariableValue(buf); 
  281.               FitnessDefault[Fitnesscount] = Fitness[Fitnesscount];
  282.               Fitnesscount++; }
  283.  
  284.         if ( variable == MODEM_TYPE )
  285.             { 
  286.                 Modems[Modemcount] = TextStrings+StringOffset; 
  287.                 GetTextString(buf);
  288.                 Modemcount++; 
  289.             }
  290.  
  291.         if ( variable == MODEM_STR_TYPE )
  292.             { 
  293.                 ModemInitStrs[ModemStrcount] = TextStrings+StringOffset; 
  294.                 GetTextString(buf);
  295.                 ModemStrcount++; 
  296.             }
  297.  
  298.         if ( variable == MODEM_INIT_TYPE )
  299.             { ModemInitList[ModemInitcount] = GetVariableValue(buf);  ModemInitcount++; }
  300.  
  301.  
  302.  
  303.         if ( variable == SPEECH_ID_STRING )
  304.             { 
  305.                 SPEECH_identifier[Speechcount] = TextStrings+StringOffset; 
  306.                 GetTextString(buf);
  307.                 Speechcount++; 
  308.  
  309.                     Starplyr++;
  310.                     if ( Starplyr>=20 )
  311.                       Starplyr = 0;
  312.             }
  313.  
  314. //        if ( variable == STAR_MAN )
  315. //            {
  316. //                StarPlayers[Starcount] = Starplyr;
  317. //                Starcount++;
  318. //            }
  319. //
  320.         if ( variable == DEFINITION_ID )
  321.             {
  322.                 Value    =    GetDefine(buf);
  323.                 fprintf( fp2, "#define    %s    %d\r\n", Definition, Value);
  324.             }
  325.  
  326.  
  327.         Getvariable(buf);
  328.     }    
  329. }
  330.  
  331. //********************************************************************************************************************************
  332.  
  333. int     GetVariableValue( char *buf )    //, int inst )
  334.     {
  335.         int      val, offset;
  336.         char     number[10];
  337.         offset    =    0;            
  338.         val    =    0;            
  339.  
  340.         if (buf[inst]==' ')
  341.             inst++;
  342.         
  343.         while ( buf[inst] > ('0'-1) && buf[inst] < ('9'+1) )
  344.         {
  345.             number[offset]    =    buf[inst];
  346.             inst++;
  347.             offset++;
  348.         }    
  349.             number[offset]    =    0;
  350.  
  351.         val         =     atoi(number);
  352.         return    ( val );
  353.     }
  354.  
  355. //********************************************************************************************************************************
  356.  
  357. char     GetFormationType( char *buf )
  358.     {
  359.         int      val, offset;
  360.         char    form    =    0;
  361.         char     number[10];
  362.         offset    =    0;            
  363.         val    =    0;            
  364.         
  365.         if (buf[inst]==' ')
  366.             inst++;
  367.                 
  368.         while ( buf[inst] > ('0'-1) && buf[inst] < ('9'+1) )
  369.         {
  370.             number[offset]    =    buf[inst];
  371.             inst++;
  372.             if (buf[inst]=='-')
  373.                 inst++;
  374.             offset++;
  375.         }    
  376.             number[offset]    =    0;
  377.             
  378.         val         =     atoi(number);
  379.  
  380.         if (val<200)
  381.             form    =    val;
  382.  
  383.         switch (val)
  384.         {
  385.             case(316):
  386.                 form    =    0;
  387.                 break;
  388.             case(406):
  389.                 form    =    1;
  390.                 break;
  391.             case(415):
  392.                 form    =    2;
  393.                 break;
  394.             case(424):
  395.                 form    =    3;
  396.                 break;
  397.             case(433):
  398.                 form    =    4;
  399.                 break;
  400.             case(442):
  401.                 form    =    5;
  402.                 break;
  403.             case(514):
  404.                 form    =    6;
  405.                 break;
  406.             case(523):
  407.                 form    =    7;
  408.                 break;
  409.             case(532):
  410.                 form    =    8;
  411.                 break;
  412.             case(631):
  413.                 form    =    9;
  414.                 break;
  415.  
  416.         }
  417.  
  418.         return    ( form );
  419.     }
  420.  
  421. //********************************************************************************************************************************
  422.  
  423. char     GetTeamsCodeNumber( char *buf )
  424.     {
  425.         char      val;
  426.         val    =    0;            
  427.         
  428.         if (buf[inst]==' ')
  429.             inst++;
  430.                 
  431.         while ( buf[inst] > ('0'-1) && buf[inst] < ('9'+1) )
  432.         {
  433.             if ( buf[inst+1] < 'a' )
  434.                 val    =     ((buf[inst+1]-'A')*4);
  435.             else
  436.                 val    =     ((buf[inst+1]-'a')*4);
  437.  
  438.             val+=    (buf[inst]-'1');
  439.             inst+=    2;
  440.         }    
  441.       return( val );
  442.     }
  443.  
  444. //********************************************************************************************************************************
  445.  
  446. char     GetPositionType( char *buf )
  447.     {
  448.         char      val;
  449.         val    =    0;            
  450.         
  451.         if (buf[inst]==' ')
  452.             inst++;
  453.                 
  454.         if ( buf[inst] == 'D' && buf[inst+1] == 'F' )
  455.             val    =    1;            
  456.         if ( buf[inst] == 'M' && buf[inst+1] == 'D' )
  457.             val    =    2;            
  458.         if ( buf[inst] == 'F' && buf[inst+1] == 'D' )
  459.             val    =    3;            
  460.  
  461.         return    ( val );
  462.     }
  463.  
  464. //********************************************************************************************************************************
  465.  
  466. short    GetDefine( char *buf )
  467.     {
  468.         char    Doffset    =    0;                    
  469.         short    Value;
  470.  
  471.         if ( buf[inst] == ' ' )
  472.             inst++;
  473.  
  474.         while ( buf[inst] > 32 )
  475.         {
  476.             Definition[Doffset] = buf[inst];
  477.             if (Doffset<15)
  478.                 Doffset++;
  479.             inst++;
  480.         }
  481.  
  482.         Definition[Doffset] = 0;
  483.  
  484.             if ( DefType == ImgSym )
  485.                 Value    =    Pagecount;
  486.         else
  487.             if ( DefType == TxtSym )
  488.                 Value    =    Stringcount;            
  489.         
  490.         return(Value);
  491.        }
  492.  
  493. //********************************************************************************************************************************
  494.  
  495. short    GetSwitch( char *buf )
  496.     {
  497.         char    Soffset    = 0;                    
  498.          tmpinst     = inst;
  499.                strcpy( Switch, "No Switch" );
  500.  
  501.         if ( buf[inst] == '[' )
  502.         {
  503.             inst++;
  504.             
  505.             if ( buf[inst] == ' ' )
  506.                 inst++;
  507.  
  508.             while ( buf[inst]!=']' && Soffset< 127 )
  509.             {
  510.                 Switch[Soffset] = buf[inst];
  511.                 if (Soffset<127)
  512.                     Soffset++;
  513.                 inst++;
  514.  
  515.                 if ( buf[inst]==' ' && buf[inst+1]==']' )
  516.                     inst++;
  517.             }
  518.  
  519.             Switch[Soffset] = 0;
  520.             strupr( Switch );            
  521.         }
  522.  
  523.          inst = tmpinst;
  524.         inst++;
  525.         return(Value);
  526.        }
  527.  
  528. //********************************************************************************************************************************
  529.  
  530. void     GetTextString( char *buf )    //, int inst )
  531.     {
  532.         char    CRflag    =    2;
  533.  
  534.         while ( CRflag!=0 )
  535.         {
  536.              if ( buf[inst] == '"' )
  537.                 CRflag--;
  538.              if ( buf[inst] > 31 && buf[inst] != '/' && buf[inst]!='"' && CRflag==1)
  539.                 {
  540.                 TextStrings[StringOffset] = buf[inst];
  541.                 StringOffset++;
  542.                 }
  543.              if ( buf[inst+1] > 31 && buf[inst] == '/' && CRflag==1)
  544.                 {
  545.                 TextStrings[StringOffset] = buf[inst+1];
  546.                 StringOffset++;
  547.                 inst++;
  548.                 }                    
  549.              if ( (buf[inst] < 31 && CRflag==1) || StringOffset> TEXT_STRING_BUFFER_LEN )
  550.                 CRflag = 0;
  551.         inst++;
  552.         }
  553.  
  554.         TextStrings[StringOffset] = 0;
  555.         StringOffset++;
  556.     }
  557.  
  558. //********************************************************************************************************************************
  559.  
  560. void     GetAscCharacter( char *buf )
  561.     {
  562.         char    CRflag    =    1;
  563.  
  564.         while ( CRflag!=0 )
  565.         {
  566.              if ( buf[inst] == '"' && buf[inst+2]== '"' )
  567.             {
  568.                 CRflag    =    0;
  569.                 ToLower[LowerCasecount] = buf[inst+1];
  570.             }
  571.         inst++;
  572.         }
  573.     }
  574.  
  575. //********************************************************************************************************************************
  576.  
  577. char     GetCharacter( char *buf )
  578.     {
  579.         char    character;
  580.         char    CRflag    =    1;
  581.  
  582.         while ( CRflag!=0 )
  583.         {
  584.              if ( buf[inst] == '"' && buf[inst+2]== '"' )
  585.             {
  586.                 CRflag    =    0;
  587.                 character = buf[inst+1];
  588.             }
  589.         inst++;
  590.         }
  591.     return(character);
  592.     }
  593.  
  594. //********************************************************************************************************************************
  595.  
  596. short     GetClubString( char *buf )    
  597.     {
  598.  
  599.  
  600.  
  601.     // ****** GET PLAYERS CLUB ******        
  602.  
  603.  
  604.  
  605.         char    PlayerClub[32];
  606.         char    string[32];
  607.         int    ClubOffset     =     0;
  608.         char    CRflag        =    2;
  609.         int    CompareOffset    =    0;
  610.         short    ClubFound    =    NOT_FOUND;
  611.         
  612.  
  613.         while ( CRflag!=0 )
  614.         {
  615.              if ( buf[inst] == '"' )
  616.                 CRflag--;
  617.  
  618.              if ( buf[inst] > 31 && buf[inst]!='"' && CRflag==1)
  619.                 {
  620.                     PlayerClub[ClubOffset] = buf[inst];
  621.                     ClubOffset++;
  622.                 }
  623.  
  624.              if ( buf[inst] < 31 && CRflag==1 )
  625.                     CRflag = 0;
  626.  
  627.              inst++;
  628.         }
  629.  
  630.         PlayerClub[ClubOffset] = 0;
  631.         ClubOffset++;
  632.  
  633.  
  634.  
  635.     // ****** SEARCH THROUGH STRING LIST FOR REPEAT OF CLUB NAME ******
  636.  
  637.  
  638.  
  639.         for ( short s=0; s < Stringcount ; s++ )             
  640.         {
  641.             int CopyOffset    =    0;
  642.             CRflag        =    1;
  643.  
  644.             Clubnames[Clubcount] = TextStrings+CompareOffset; 
  645.  
  646.             while ( CRflag!=0 )
  647.             {
  648.                 if ( TextStrings[CompareOffset] == 0 )
  649.                 {
  650.                     string[CopyOffset] = 0;
  651.                      CRflag    =    0;
  652.                 }
  653.  
  654.                 else
  655.                 {   
  656.                     string[CopyOffset] = TextStrings[CompareOffset];
  657.                 }
  658.  
  659.                 CopyOffset++;
  660.                 CompareOffset++;
  661.             }
  662.             
  663.  
  664.             if ( strcmpi( PlayerClub, string ) == 0 )
  665.             {
  666.                      ClubFound    =    s;        
  667.                 break;
  668.             }
  669.         }
  670.  
  671.  
  672.     // ****** THROW CLUB STRING INTO TEXT LIST ******
  673.  
  674.             
  675.             if ( ClubFound == NOT_FOUND )
  676.             {
  677.                 Clubnames[Clubcount] = TextStrings+StringOffset; 
  678.  
  679.                 for ( char t=0; t < (strlen(PlayerClub)); t++ )             
  680.                 {
  681.                     TextStrings[StringOffset] = PlayerClub[t];
  682.                     StringOffset++;
  683.                 }
  684.  
  685.                        TextStrings[StringOffset] = 0;
  686.                        StringOffset++;
  687.             }        
  688.  
  689.  
  690.  
  691.         
  692.         return(ClubFound);
  693.     }
  694.  
  695. //********************************************************************************************************************************
  696.  
  697. void     Getvariable( char *buf )      
  698.     {
  699.         variable = NO_INSTRUCTION;
  700.                     
  701.         while ( buf[inst] != 0 && variable == NO_INSTRUCTION )
  702.         {
  703.  
  704.             if ( buf[inst+1] == ':' && buf[inst-1] <= ' ')
  705.             {
  706.                 if ( buf[inst] == 'x' )
  707.                      {variable = IMAGE_xCOORD; inst+=2;} 
  708.                 if ( buf[inst] == 'y' )
  709.                      {variable = IMAGE_yCOORD; inst+=2;}
  710.                 if ( buf[inst] == 'w' )
  711.                      {variable = IMAGE_WIDTH; inst+=2;}
  712.                 if ( buf[inst] == 'h' )
  713.                      {variable = IMAGE_HEIGHT; inst+=2;}
  714.                 if ( buf[inst] == 'p' )
  715.                      {variable = IMAGE_PAGE; inst+=2;}
  716.                 if ( buf[inst] == 't' )
  717.                      {variable = TEXT_STRING; inst+=2;}
  718.             }
  719.  
  720.                 if ( buf[inst] == '' && EUROsymbol == 1 )
  721.                      {variable = DEFINITION_ID; inst+=2;}
  722.  
  723.             if ( buf[inst+4] == ':' || buf[inst+3] == ':' || buf[inst+5] == ':' )
  724.             {
  725.                 if ( buf[inst] == 'f' && buf[inst+1] == 'o' && buf[inst+2] == 'r' && buf[inst+3] == 'm' )
  726.                      {variable = FORMATION_TYPE; inst+=5; break;}
  727.                 if ( buf[inst] == 'd' && buf[inst+1] == 'r' && buf[inst+2] == 'a' && buf[inst+3] == 'w' )
  728.                      {variable = GROUP_DRAW_TYPE; inst+=5; break;}
  729.                 if ( buf[inst] == 'c' && buf[inst+1] == 'l' && buf[inst+2] == 'u' && buf[inst+3] == 'b' && Datecount < 320 )
  730.                      {variable = PLAYERS_CLUB_NAME; inst+=5; break;}
  731.                 if ( buf[inst] == 'p' && buf[inst+1] == 'o' && buf[inst+2] == 's' && buf[inst+3] == 'n' && Posncount < 320 )
  732.                      {variable = PLAYERS_POSITION; inst+=5; break;}
  733.                 if ( buf[inst] == 'c' && buf[inst+1] == 'a' && buf[inst+2] == 'p' && buf[inst+3] == 's' && Capscount < 320 )
  734.                      {variable = CAPS_TYPE; inst+=5; break;}
  735.                 if ( buf[inst] == 'g' && buf[inst+1] == 'o' && buf[inst+2] == 'a' && buf[inst+3] == 'l' && Goalscount < 320 )
  736.                      {variable = GOALS_TYPE; inst+=5; break;}
  737.                 if ( buf[inst] == 'p' && buf[inst+1] == 'a' && buf[inst+2] == 'c' && buf[inst+3] == 'e' && Pacecount < 320 )
  738.                      {variable = PACE_TYPE; inst+=5; break;}
  739.                 if ( buf[inst] == 'p' && buf[inst+1] == 'o' && buf[inst+2] == 'w' && Powercount < 320 )
  740.                      {variable = POWER_TYPE; inst+=4; break;}
  741.                 if ( buf[inst] == 'c' && buf[inst+1] == 'n' && buf[inst+2] == 't' && buf[inst+3] == 'l' && Controlcount < 320 )
  742.                      {variable = CONTROL_TYPE; inst+=5; break;}
  743.                 if ( buf[inst] == 'f' && buf[inst+1] == 'l' && buf[inst+2] == 'a' && buf[inst+3] == 'r' && Flaircount < 320 )
  744.                      {variable = FLAIR_TYPE; inst+=5; break;}
  745.                 if ( buf[inst] == 'v' && buf[inst+1] == 'i' && buf[inst+2] == 's' && buf[inst+3] == 'n' && Visioncount < 320 )
  746.                      {variable = VISION_TYPE; inst+=5; break;}
  747.                 if ( buf[inst] == 'a' && buf[inst+1] == 'c' && buf[inst+2] == 'c' && Accuracycount < 320 )
  748.                      {variable = ACCURACY_TYPE; inst+=4; break;}
  749.                 if ( buf[inst] == 's' && buf[inst+1] == 't' && buf[inst+2] == 'a' && buf[inst+3] == 'm' && Staminacount < 320 )
  750.                      {variable = STAMINA_TYPE; inst+=5; break;}
  751.                 if ( buf[inst] == 'd' && buf[inst+1] == 'i' && buf[inst+2] == 's' && buf[inst+3] == 'c' && Disciplinecount < 320 )
  752.                      {variable = DISCIPLINE_TYPE; inst+=5; break;}
  753.                   if ( buf[inst] == 'f' && buf[inst+1] == 'i' && buf[inst+2] == 't' && Fitnesscount < 320 )
  754.                      {variable = FITNESS_TYPE; inst+=4; break;}
  755.                 if ( buf[inst] == 'd' && buf[inst+1] == 'o' && buf[inst+2] == 'b' && Datecount < 320 )
  756.                      {variable = DOB_TYPE; inst+=4; break;}
  757.                 if ( buf[inst] == 'n' && buf[inst+1] == 'a' && buf[inst+2] == 'm' && buf[inst+3] == 'e' && Speechcount < 320 )
  758.                      {variable = SPEECH_ID_STRING; inst+=5; break;}
  759.                 if ( buf[inst] == 'l' && buf[inst+1] == 'o' && buf[inst+2] == 'w' )
  760.                      {variable = LOWER_CASE; inst+=4; break;}
  761.                 if ( buf[inst] == 'd' && buf[inst+1] == 'i' && buf[inst+2] == 'a' && buf[inst+3] == 'l' &&
  762.                         Dialcount < 129 )
  763.                      {variable = DIAL_TYPE; inst+=5; break;}
  764.  
  765.                 if ( buf[inst] == 'i' && buf[inst+1] == 'n' && buf[inst+2] == 'i' && buf[inst+3] == 't' )
  766.                      {variable = MODEM_INIT_TYPE; inst+=5;break;}
  767.                 if ( buf[inst] == 'm' && buf[inst+1] == 'o' && buf[inst+2] == 'd' && buf[inst+3] == 'e' 
  768.                     && buf[inst+4] == 'm'  )
  769.                      {variable = MODEM_TYPE; inst+=6; break;}
  770.                 if ( buf[inst] == 'm' && buf[inst+1] == 's' && buf[inst+2] == 't' && buf[inst+3] == 'r' )
  771.                      {variable = MODEM_STR_TYPE; inst+=5; break;}
  772.             }
  773.  
  774. //            if ( buf[inst] == '(' && buf[inst+1] == '*' && buf[inst+2] == ')' )
  775. //                     {variable = STAR_MAN; inst+=3; break;}
  776.  
  777.  
  778.  
  779.             // *** Preccess SWITCH Command ***
  780.  
  781.             if (variable == NO_INSTRUCTION)
  782.             {
  783.                 GetSwitch(buf);
  784.  
  785.                 if ( !strcmp( Switch, "IMAGE DATA") )
  786.                     DefType    =    ImgSym;
  787.                 
  788.                 if ( !strcmp( Switch, "TEXT DATA") )
  789.                     DefType    =    TxtSym;
  790.  
  791.                 if ( !strcmp( Switch, "ANDY'S TEXT DATA") )
  792.                 {
  793.                         Stringcount = ANDYF_TEXT_START;
  794.                     DefType        = TxtSym;
  795.                 }
  796.  
  797.                 if ( !strcmp( Switch, "LAURENT'S TEXT DATA") )
  798.                 {
  799.                         Stringcount = LAURENT_TEXT_START;
  800.                     DefType        = TxtSym;
  801.                 }
  802.  
  803.  
  804.                 if ( (!strcmp( Switch, "MC")) || 
  805.                      (!strcmp( Switch, "LE")) )
  806.                     NamePREFIXtbl[Stringcount-1] = 1;
  807.  
  808.                 if ( !strcmp( Switch, "*") )
  809.                 {
  810.                     StarPlayers[Starcount] = Starplyr;
  811.                     Starcount++;
  812.                 }
  813.             }
  814.         }    
  815.     }
  816.  
  817. //********************************************************************************************************************************
  818.